﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:Element="clr-namespace:SegmentDisplay.Common.Element;assembly=SegmentDisplay.Common"
                    xmlns:Date="clr-namespace:SegmentDisplay.Custom.Time"
                    xmlns:digit07="clr-namespace:SegmentDisplay.Common.Digit07;assembly=SegmentDisplay.Common"
                    xmlns:digit09="clr-namespace:SegmentDisplay.Common.Digit09;assembly=SegmentDisplay.Common"
                    xmlns:digit14="clr-namespace:SegmentDisplay.Common.Digit14;assembly=SegmentDisplay.Common"
                    xmlns:digit16="clr-namespace:SegmentDisplay.Common.Digit16;assembly=SegmentDisplay.Common"
                    >

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/SegmentDisplay.Common;component/Element/Resources.xaml" />
        <ResourceDictionary Source="pack://application:,,,/SegmentDisplay.Common;component/Digit07/Resources.xaml" />
        <ResourceDictionary Source="pack://application:,,,/SegmentDisplay.Common;component/Digit09/Resources.xaml" />
        <ResourceDictionary Source="pack://application:,,,/SegmentDisplay.Common;component/Digit14/Resources.xaml" />
        <ResourceDictionary Source="pack://application:,,,/SegmentDisplay.Common;component/Digit16/Resources.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <!--Resource dictionary for Indicator Date control-->

    <!--IndicatorTime07-->
    <ControlTemplate x:Key="IndicatorTime07Template"  TargetType="{x:Type Date:IndicatorTime}">
        <Viewbox Height="{TemplateBinding Height}" >
            <Grid Background="{TemplateBinding Background}" Margin="{TemplateBinding Margin}" >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>

                <!--Hours-->
                <digit07:SegmentDigit07 Grid.Column="0" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}"
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding DigitStyle}"
                                 Value="{TemplateBinding H1}"/>
                <digit07:SegmentDigit07 Grid.Column="1" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}" 
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding DigitStyle}"
                                 Value="{TemplateBinding H2}"/>

                <!--Delimiter-->
                <Element:SegmentElement Grid.Column="2" Height="{TemplateBinding Height}" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}" 
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding SeparatorStyle}"
                                 Value="{TemplateBinding Delimiter}"/>

                <!--Minutes-->
                <digit07:SegmentDigit07 Grid.Column="3" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}"
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding DigitStyle}"
                                 Value="{TemplateBinding M1}"/>
                <digit07:SegmentDigit07 Grid.Column="4" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}" 
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding DigitStyle}"
                                 Value="{TemplateBinding M2}"/>

                <!--Delimiter-->
                <Element:SegmentElement Grid.Column="5" Height="{TemplateBinding Height}" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}" 
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding SeparatorStyle}"
                                 Value="{TemplateBinding Delimiter}"/>

                <!--Seconds-->
                <digit07:SegmentDigit07 Grid.Column="6" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}"
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding DigitStyle}"
                                 Value="{TemplateBinding S1}"/>
                <digit07:SegmentDigit07 Grid.Column="7" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}" 
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding DigitStyle}"
                                 Value="{TemplateBinding S2}"/>
            </Grid>
        </Viewbox>
    </ControlTemplate>

    <Style x:Key="IndicatorTime07Style" TargetType="{x:Type Date:IndicatorTime}">
        <Setter Property="Template" Value="{StaticResource IndicatorTime07Template}" />
    </Style>

    <!--IndicatorTime09-->
    <ControlTemplate x:Key="IndicatorTime09Template"  TargetType="{x:Type Date:IndicatorTime}">
        <Viewbox Height="{TemplateBinding Height}" >
            <Grid Background="{TemplateBinding Background}" Margin="{TemplateBinding Margin}" >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>

                <!--Hours-->
                <digit09:SegmentDigit09 Grid.Column="0" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}"
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding DigitStyle}"
                                 Value="{TemplateBinding H1}"/>
                <digit09:SegmentDigit09 Grid.Column="1" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}" 
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding DigitStyle}"
                                 Value="{TemplateBinding H2}"/>

                <!--Delimiter-->
                <Element:SegmentElement Grid.Column="2" Height="{TemplateBinding Height}" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}" 
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding SeparatorStyle}"
                                 Value="{TemplateBinding Delimiter}"/>

                <!--Minutes-->
                <digit09:SegmentDigit09 Grid.Column="3" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}"
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding DigitStyle}"
                                 Value="{TemplateBinding M1}"/>
                <digit09:SegmentDigit09 Grid.Column="4" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}" 
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding DigitStyle}"
                                 Value="{TemplateBinding M2}"/>

                <!--Delimiter-->
                <Element:SegmentElement Grid.Column="5" Height="{TemplateBinding Height}" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}" 
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding SeparatorStyle}"
                                 Value="{TemplateBinding Delimiter}"/>

                <!--Seconds-->
                <digit09:SegmentDigit09 Grid.Column="6" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}"
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding DigitStyle}"
                                 Value="{TemplateBinding S1}"/>
                <digit09:SegmentDigit09 Grid.Column="7" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}" 
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding DigitStyle}"
                                 Value="{TemplateBinding S2}"/>
            </Grid>
        </Viewbox>
    </ControlTemplate>

    <Style x:Key="IndicatorTime09Style" TargetType="{x:Type Date:IndicatorTime}">
        <Setter Property="Template" Value="{StaticResource IndicatorTime09Template}" />
    </Style>


    <!--IndicatorTime 14-->
    <ControlTemplate x:Key="IndicatorTime14Template"  TargetType="{x:Type Date:IndicatorTime}">
        <Viewbox Height="{TemplateBinding Height}" >
            <Grid Background="{TemplateBinding Background}" Margin="{TemplateBinding Margin}" >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>

                <!--Hours-->
                <digit14:SegmentDigit14 Grid.Column="0" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}"
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding DigitStyle}"
                                 Value="{TemplateBinding H1}"/>
                <digit14:SegmentDigit14 Grid.Column="1" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}" 
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding DigitStyle}"
                                 Value="{TemplateBinding H2}"/>

                <!--Delimiter-->
                <Element:SegmentElement Grid.Column="2" Height="{TemplateBinding Height}" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}" 
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding SeparatorStyle}"
                                 Value="{TemplateBinding Delimiter}"/>

                <!--Minutes-->
                <digit14:SegmentDigit14 Grid.Column="3" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}"
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding DigitStyle}"
                                 Value="{TemplateBinding M1}"/>
                <digit14:SegmentDigit14 Grid.Column="4" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}" 
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding DigitStyle}"
                                 Value="{TemplateBinding M2}"/>

                <!--Delimiter-->
                <Element:SegmentElement Grid.Column="5" Height="{TemplateBinding Height}" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}" 
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding SeparatorStyle}"
                                 Value="{TemplateBinding Delimiter}"/>

                <!--Seconds-->
                <digit14:SegmentDigit14 Grid.Column="6" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}"
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding DigitStyle}"
                                 Value="{TemplateBinding S1}"/>
                <digit14:SegmentDigit14 Grid.Column="7" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}" 
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding DigitStyle}"
                                 Value="{TemplateBinding S2}"/>
            </Grid>
        </Viewbox>
    </ControlTemplate>

    <Style x:Key="IndicatorTime14Style" TargetType="{x:Type Date:IndicatorTime}">
        <Setter Property="Template" Value="{StaticResource IndicatorTime14Template}" />
    </Style>

    <!--IndicatorTime 16-->
    <ControlTemplate x:Key="IndicatorTime16Template"  TargetType="{x:Type Date:IndicatorTime}">
        <Viewbox Height="{TemplateBinding Height}" >
            <Grid Background="{TemplateBinding Background}" Margin="{TemplateBinding Margin}" >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>

                <!--Hours-->
                <digit16:SegmentDigit16 Grid.Column="0" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}"
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding DigitStyle}"
                                 Value="{TemplateBinding H1}"/>
                <digit16:SegmentDigit16 Grid.Column="1" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}" 
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding DigitStyle}"
                                 Value="{TemplateBinding H2}"/>

                <!--Delimiter-->
                <Element:SegmentElement Grid.Column="2" Height="{TemplateBinding Height}" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}" 
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding SeparatorStyle}"
                                 Value="{TemplateBinding Delimiter}"/>

                <!--Minutes-->
                <digit16:SegmentDigit16 Grid.Column="3" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}"
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding DigitStyle}"
                                 Value="{TemplateBinding M1}"/>
                <digit16:SegmentDigit16 Grid.Column="4" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}" 
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding DigitStyle}"
                                 Value="{TemplateBinding M2}"/>

                <!--Delimiter-->
                <Element:SegmentElement Grid.Column="5" Height="{TemplateBinding Height}" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}" 
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding SeparatorStyle}"
                                 Value="{TemplateBinding Delimiter}"/>

                <!--Seconds-->
                <digit16:SegmentDigit16 Grid.Column="6" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}"
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding DigitStyle}"
                                 Value="{TemplateBinding S1}"/>
                <digit16:SegmentDigit16 Grid.Column="7" Margin="4"
                                 LightOn="{TemplateBinding LightOn}" LightOff="{TemplateBinding LightOff}" 
                                 IsSwitchOn="{TemplateBinding IsSwitchOn}"
                                 Style="{TemplateBinding DigitStyle}"
                                 Value="{TemplateBinding S2}"/>
            </Grid>
        </Viewbox>
    </ControlTemplate>

    <Style x:Key="IndicatorTime16Style" TargetType="{x:Type Date:IndicatorTime}">
        <Setter Property="Template" Value="{StaticResource IndicatorTime16Template}" />
    </Style>
</ResourceDictionary>